DROP TABLE IF EXISTS jms_ods.yl_oms_oms_order_back_detail ;
CREATE EXTERNAL TABLE jms_ods.yl_oms_oms_order_back_detail (
ID          bigint          comment     ''     ,         --NUMBER(20)
ORDER_ID          bigint          comment     '订单编号'     ,         --NUMBER(20)
WAYBILL_NO          string          comment     '运单编号'     ,         --NVARCHAR2(30)
ORDER_SOURCE_CODE          string          comment     '订单来源编号'     ,         --NVARCHAR2(30)
ORDER_SOURCE_NAME          string          comment     '订单来源名称'     ,         --NVARCHAR2(60)
D_OPERATION_NETWORK_ID          bigint          comment     '调度操作网点ID'     ,         --NUMBER(11)
D_OPERATION_NETWORK_CODE          string          comment     '调度操作网点编号'     ,         --NVARCHAR2(30)
D_OPERATION_NETWORK_NAME          string          comment     '调度操作网点名称'     ,         --NVARCHAR2(60)
D_OPERATION_STAFF_CODE          string          comment     '调度操作网点人员编号'     ,         --NVARCHAR2(30)
D_OPERATION_STAFF_NAME          string          comment     '调度操作网点人员姓名'     ,         --NVARCHAR2(60)
BACK_OPERATION_NETWORK_ID          bigint          comment     '打回网点ID'     ,         --NUMBER(11)
BACK_OPERATION_NETWORK_CODE          string          comment     '打回网点编号'     ,         --NVARCHAR2(30)
BACK_OPERATION_NETWORK_NAME          string          comment     '打回网点名称'     ,         --NVARCHAR2(60)
BACK_OPERATION_STAFF_ID          bigint          comment     ''     ,         --NUMBER(11)
BACK_OPERATION_STAFF_CODE          string          comment     '打回人员工号'     ,         --NVARCHAR2(30)
BACK_OPERATION_STAFF_NAME          string          comment     '打回人员姓名'     ,         --NVARCHAR2(60)
BACK_REASON_CODE          bigint          comment     '打回原因CODE'     ,         --NUMBER(11)
BACK_REASON          string          comment     '打回订单原因'     ,         --NVARCHAR2(300)
BACK_EXPLAIN          string          comment     '打回订单说明'     ,         --NVARCHAR2(300)
BACK_TIME          timestamp          comment     '打回订单时间'     ,         --DATE
BACK_TIMES          bigint          comment     '打回订单次数'     ,         --NUMBER(11)
SENDER_PROVINCE_ID          bigint          comment     '寄件省份ID'     ,         --NUMBER(11)
SENDER_PROVINCE_NAME          string          comment     '寄件省份名称'     ,         --NVARCHAR2(60)
SENDER_CITY_ID          bigint          comment     '寄件城市ID'     ,         --NUMBER(11)
SENDER_CITY_NAME          string          comment     '寄件城市名称'     ,         --NVARCHAR2(60)
SENDER_AREA_ID          bigint          comment     '寄件区域ID'     ,         --NUMBER(11)
SENDER_AREA_NAME          string          comment     '寄件区域名称'     ,         --NVARCHAR2(60)
SENDER_DETAILED_ADDRESS          string          comment     '寄件详细地址'     ,         --NVARCHAR2(300)
CREATE_TIME          timestamp          comment     '创建时间'     ,         --DATE
UPDATE_TIME          timestamp          comment     '更新时间'     ,         --DATE
PROXY_AREA_CODE          string          comment     '代理区编码'     ,         --NVARCHAR2(30)
PROXY_AREA_NAME          string          comment     '代理区名称'     ,         --NVARCHAR2(60)
PROXY_AREA_ID          bigint          comment     '代理区id'     ,         --NUMBER(11)
DISPATCH_NETWORK_TIME          timestamp          comment     '调度网点时间'     ,         --DATE
BACK_DURATION          bigint          comment     '打回距离调度网点时长，单位min'     ,         --NUMBER(11)
IS_OVERTIME          string          comment     '是否超时：0表示未超时1表示超时'     ,         --NVARCHAR2(4)
INPUT_TIME          timestamp          comment     '订单录入时间'              --DATE
)
    COMMENT  '订单打回详情表'
    PARTITIONED BY (dt STRING COMMENT '时间分区')
    STORED AS PARQUET
    LOCATION '/dw/hive/jms_ods.db/external/yl_oms_oms_order_back_detail'
    TBLPROPERTIES (
        'discover.partitions' = 'false',
        'parquet.column.index.access' = 'true'
        );

MSCK REPAIR TABLE jms_ods.yl_oms_oms_order_back_detail;
